/*
putter-1.1.h
offer putter 1.1 version putter function api extern
designed by lunanting

----------------------
2020-08-10 14:18:15
create file
----------------------
*/
#ifndef __PUTTER_1_1_H
#define __PUTTER_1_1_H

#include "../../bsp/base_type.h"
#ifdef OK1054W
#include "../../../board/ok1054w/board/board.h"
#else
#include "../../../board/ok1053w/board/board.h"
#endif

/****************putter config*********************/
#define PUTTER1_1_ratio 50/30       //减速比
#define PUTTER1_1_dis   10           //螺距：mm
#define PUTTER1_1_speed 300         //电机转速r/min



// io config
#define PUTTER1_limit_bk    9   //退后后限位
#define PUTTER1_limit_fw    11  //推杆前限位
#define PUTTER1_io_touch    0   //io 触发状态


/****************data type define*********************/

//putter1.1 class
typedef struct{
    u8 init;            //init state
    u16 speed;          //speed
    u8 set_foot;        //set move list foot
    u8 get_foot;        //get move list foot
    int location;       //putter location
    int list[5];        //move list
}PUTTER1_class;




/*****************function extern*******************/

extern int xp_putter1_init(u8 slave_id,u16 speed);    //putter init
extern int xp_putter1_stop(void); //putter1 stop
extern void xp_putter1_set_move(int position);  //putter set move task
extern int xp_putter1_checkZero(void);  //check zero
extern int xp_putter1_get_pos(void);
extern int xp_putter1_move(int dis);    //putter move
extern int xp_putter1_debug(char *type,char *fun,char *param);  //putter1.1 debug


#endif
//end of the file
